<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>显示流程图</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../lib/bpmn-js/dist/assets/diagram-js.css">
  <link rel="stylesheet" href="../lib/bpmn-js/dist/assets/bpmn-font/css/bpmn.css">
  <link rel="stylesheet" href="../lib/mdui/css/mdui.min.css" type="text/css">
</head>
<body class="mdui-theme-primary-indigo mdui-theme-accent-pink">
<div class="mdui-toolbar mdui-color-theme">
  <a href="../index.html" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">arrow_back</i></a>
  <span class="mdui-typo-title">查看流程图</span>
  <div class="mdui-toolbar-spacer"></div>
</div>
<div id="js-canvas" style="height: calc(100% - 64px);"></div>

<script src="../lib/bpmn-js/dist/bpmn-viewer.development.js"></script>
<script src="../lib/jquery/jquery.js"></script>
<script src="../lib/mdui/js/mdui.min.js"></script>
<script>
  var viewer = new BpmnJS({
    container: $('#js-canvas'),
    height: 600
  });
  function openFromUrl(url) {
    console.log('attempting to open <' + url + '>');
    $.ajax(url, { dataType : 'text' }).done(function(xml) {
      viewer.importXML(xml, function(err) {
        if (err) {
          console.log('error: ' + err.message);
          console.error(err);
        } else {
          viewer.get('canvas').zoom('fit-viewport');
          console.log('success');
        }
      });
    });
  }
  (function () {
    openFromUrl('../assets/1002.bpmn');
  })();
</script>
</body>
</html>
